#include<bits/stdc++.h>
#define int long long
#define double long double
#define rep(i,l,r) for(int i=(l),i##end=(r);i<=i##end;++i)
#define per(i,r,l) for(int i=(r),i##end=(l);i>=i##end;--i)
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
using namespace std;
const int maxn=2e6+10,maxm=1e6+10,mod=998244353,inf=1e18;
inline int ksm(int x,int k,int mod=mod){
    int ans=1;
    for(;k;k>>1,x=x*x%mod) if(k&1) ans=ans*x%mod;
    return ans;
}

int n,m[maxn],t[maxn];
vector<int> a[maxn];

signed main(){
    freopen("mcmf.in","r",stdin),freopen("mcmf.out","w",stdout);
    ios::sync_with_stdio,cin.tie(0),cout.tie(0);
    cin>>n;
    rep(i,1,n){
        cin>>m[i];
        rep(j,1,m[i]){
            int x;
            cin>>x,a[i].pb(x),++t[x];
        }
    }
    rep(i,1,2e6) if(t[i]>1) t[i+1]+=t[i]-1,t[i]=1;
    per(i,1e6,1) if(t[i]){
        rep(j,1,i) cout<<bool(t[j]);
        return 0;
    }
    return 0;
}